/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.hieptq.btvn1;

import java.util.Scanner;

/**
 *
 * @author Hiep
 */
public class Bai5 {
    public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		System.out.print("Nhap n: ");
		int n=sc.nextInt();
	if(n<=2)
		System.out.println("n phai lon hon 2");
	else{
		int f1=1,f2=1,tong=0;
	for(int i=3;i<=n;i++){
		tong=f1+f2;
		f2=f1;
		f1=tong;
	}
		System.out.println("So fibonacci thu "+n+" la: "+tong);
		}
	}

}
